package kr.co.doriclassic.pro07_01;

import java.util.Scanner;

class Rectangle {
	private int width;
	private int height;
	private int iRectArea;
	private int iRectPerimeter;
	
	public Rectangle(int width, int height) {
		this.width=width;
		this.height=height;
	}
	
	public int area(){
		iRectArea=width*height;
		return iRectArea;
	}
	
	public int perimeter(){
		iRectPerimeter=(width+height)*2;
		return iRectPerimeter;
	}
}
public class Pro07_01{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int iW, iH;
		int iA, iP;
		
		System.out.print("사각형 너비:");
		iW=sc.nextInt();
		System.out.print("사각형 높이:");
		iH=sc.nextInt();
		
		Rectangle rc = new Rectangle(iW, iH);
		iA=rc.area();
		iP=rc.perimeter();
		
		System.out.printf("너비 %d, 높이 %d인 사각형의 넓이는 %d이고, 둘레는 %d이다.", iW, iH, iA, iP);
	}
}